/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv.com.compassion.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/** Clase entidad para el mapeo de tabla de base de datos Visitas
* @author grupo de Tesis
*/
@Entity
@Table(name = "visitas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Visitas.findAll", query = "SELECT v FROM Visitas v"),
    @NamedQuery(name = "Visitas.findByIdVisitas", query = "SELECT v FROM Visitas v WHERE v.idVisitas = :idVisitas"),
    @NamedQuery(name = "Visitas.findByFecVisita", query = "SELECT v FROM Visitas v WHERE v.fecVisita = :fecVisita"),
    @NamedQuery(name = "Visitas.findByCantVisita", query = "SELECT v FROM Visitas v WHERE v.cantVisita = :cantVisita"),
    @NamedQuery(name = "Visitas.findByEstVisita", query = "SELECT v FROM Visitas v WHERE v.estVisita = :estVisita"),
    @NamedQuery(name = "Visitas.findByAuAddUsr", query = "SELECT v FROM Visitas v WHERE v.auAddUsr = :auAddUsr"),
    @NamedQuery(name = "Visitas.findByAuAddDat", query = "SELECT v FROM Visitas v WHERE v.auAddDat = :auAddDat"),
    @NamedQuery(name = "Visitas.findByAuModUsr", query = "SELECT v FROM Visitas v WHERE v.auModUsr = :auModUsr"),
    @NamedQuery(name = "Visitas.findByAuModDat", query = "SELECT v FROM Visitas v WHERE v.auModDat = :auModDat")})
public class Visitas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idVisitas")
    private Integer idVisitas;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecVisita")
    @Temporal(TemporalType.DATE)
    private Date fecVisita;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cantVisita")
    private int cantVisita;
    @Basic(optional = false)
    @NotNull
    @Column(name = "estVisita")
    private int estVisita;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddUsr")
    private int auAddUsr;
    @Basic(optional = false)
    @NotNull
    @Column(name = "AuAddDat")
    @Temporal(TemporalType.DATE)
    private Date auAddDat;
    @Column(name = "AuModUsr")
    private Integer auModUsr;
    @Column(name = "AuModDat")
    @Temporal(TemporalType.DATE)
    private Date auModDat;
    @JoinColumn(name = "idBeneficiario", referencedColumnName = "idBeneficiario")
    @ManyToOne(optional = false)
    private Beneficiario idBeneficiario;

    public Visitas() {
    }

    public Visitas(Integer idVisitas) {
        this.idVisitas = idVisitas;
    }

    public Visitas(Integer idVisitas, Date fecVisita, int cantVisita, int estVisita, int auAddUsr, Date auAddDat) {
        this.idVisitas = idVisitas;
        this.fecVisita = fecVisita;
        this.cantVisita = cantVisita;
        this.estVisita = estVisita;
        this.auAddUsr = auAddUsr;
        this.auAddDat = auAddDat;
    }

    public Integer getIdVisitas() {
        return idVisitas;
    }

    public void setIdVisitas(Integer idVisitas) {
        this.idVisitas = idVisitas;
    }

    public Date getFecVisita() {
        return fecVisita;
    }

    public void setFecVisita(Date fecVisita) {
        this.fecVisita = fecVisita;
    }

    public int getCantVisita() {
        return cantVisita;
    }

    public void setCantVisita(int cantVisita) {
        this.cantVisita = cantVisita;
    }

    public int getEstVisita() {
        return estVisita;
    }

    public void setEstVisita(int estVisita) {
        this.estVisita = estVisita;
    }

    public int getAuAddUsr() {
        return auAddUsr;
    }

    public void setAuAddUsr(int auAddUsr) {
        this.auAddUsr = auAddUsr;
    }

    public Date getAuAddDat() {
        return auAddDat;
    }

    public void setAuAddDat(Date auAddDat) {
        this.auAddDat = auAddDat;
    }

    public Integer getAuModUsr() {
        return auModUsr;
    }

    public void setAuModUsr(Integer auModUsr) {
        this.auModUsr = auModUsr;
    }

    public Date getAuModDat() {
        return auModDat;
    }

    public void setAuModDat(Date auModDat) {
        this.auModDat = auModDat;
    }

    public Beneficiario getIdBeneficiario() {
        return idBeneficiario;
    }

    public void setIdBeneficiario(Beneficiario idBeneficiario) {
        this.idBeneficiario = idBeneficiario;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idVisitas != null ? idVisitas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Visitas)) {
            return false;
        }
        Visitas other = (Visitas) object;
        if ((this.idVisitas == null && other.idVisitas != null) || (this.idVisitas != null && !this.idVisitas.equals(other.idVisitas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sv.com.compassion.entidades.Visitas[ idVisitas=" + idVisitas + " ]";
    }
    
}
